package com.xuan.service.impl;

import com.xuan.entity.User;
import com.xuan.mapper.UserMapper;
import com.xuan.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xuan
 * @since 2025-01-14
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public boolean addUser(User user) {
        return this.save(user);
    }
    @Override
    public boolean updateUser(Long id, User user) {
        user.setId(id);  // 设置 ID
        return this.updateById(user);
    }

    @Override
    public boolean deleteUser(Long id) {
        return this.removeById(id);
    }



}
